jsx3.require("tibco.admin.enterpriseAssets.EnterpriseAssetsTabInterface");

/**
 * Machines
 */
jsx3.lang.Package.definePackage("tibco.admin.enterpriseAssets.keyMgt", function (keys) {
});

/**
 * Machines
 */
jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.keyMgt.Keys",
        jsx3.lang.Object,
        [tibco.admin.enterpriseAssets.EnterpriseAssetsTabInterface],
        function (plugin) {
            plugin.instance = null

            plugin.prototype.init = function() {
                this.jsxsuper();
            }

            plugin.prototype.getNamespace = function() {
                return "tibco.admin";
            }

            plugin.prototype.destroyPlugin = function() {
            }

            plugin.prototype.initPlugin = function() {
            }

            plugin.getInstance = function(args) {
                if(!this.instance) {
                    this.instance = new tibco.admin.enterpriseAssets.keyMgt.Keys();
                }
                return this.instance;
            }

            plugin.prototype.getComponentPath = function() {
                return  "tibco/admin/enterpriseAssets/keyMgt/component.xml"
            }

            plugin.prototype.loadComponent = function(parent) {
                tibco.admin.Main.loadUIResourceAsync(parent, "tibco.admin", "tibco/admin/enterpriseAssets/keyMgt/components/keystore.xml");
            }

            plugin.prototype.detailsLoaded = function(objEvent) {
                if(objEvent.status == "SUCCESS") {
                    this.childDetails = objEvent.obj;
                    var me = this;
                    this.childDetails.handler = me;
                }
            }

            plugin.prototype.listLoaded = function(objEvent) {
                if(objEvent.status == "SUCCESS") {
                    this.childList = objEvent.obj;
                    var me = this;
                    this.childList.handler = me;
                }
            }

            plugin.prototype.beginEdit = function() {
                this.beginEditMode();
                this.childList.beginEditMode();
            }

            plugin.prototype.endEdit = function() {
                this.endEditMode();
                this.childList.endEditMode();
            }

            plugin.prototype.tabSelected = function() {
                this.childList.onRefresh();
            }

            plugin.prototype.getTabText = function() {
                return tibco.admin.Main.getServer().getDynamicProperty("@@Keystore_20")
            }

        });